import Http from '../http';

export const checkMenuAuth = function(curMenuCode:string) {
    return Http.get('/sys-menu/checkMenuAuth',{menuCode: curMenuCode})
}

export const selectAllSysMenuTree = function() {
    return Http.get('/sys-menu/selectAllSysMenuTree')
}

export const selectAllForLayMenuTree = function() {
    return Http.get('/sys-menu/selectAllForLayMenuTree')
}


export const removeMenu = function(id:Number) {
    return Http.delete('/sys-menu/remove/'+id)
}

export const addMenu = function (data: {}) {
    return Http.post("/sys-menu/add",data)
};


export const addSubMenu = function (data: {}) {
    return Http.post("/sys-menu/addSub",data)
};

export const editMenu = function (data: object) {
    return Http.post("/sys-menu/edit",data)
};

export const detailMenu = function(id:Number) {
    return Http.get('/sys-menu/detail/'+id)
}

export const statusMenu = function (data: object) {
    return Http.post("/sys-menu/status",data)
};

export const selectMenuIdListByRoleId = function (roleId: number) {
    return Http.get("/sys-menu/selectMenuIdListByRoleId/"+roleId)
};
